package com.sugar.follow.up.module.business.controller.admin.patient.gzxss.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.sugar.follow.up.module.business.framework.web.convert.ListToStringConverter;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

import cn.idev.excel.annotation.*;

import static com.sugar.follow.up.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
import static com.sugar.follow.up.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 根治性手术 Response VO")
@Data
@ExcelIgnoreUnannotated
public class PatientGzxssRespVO {

    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8940")
    @ExcelProperty("ID")
    private Long id;

    @Schema(description = "就诊人ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14001")
    @ExcelProperty("就诊人ID")
    private Long patientId;

    @Schema(description = "就诊人姓名（冗余）", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
    @ExcelProperty("就诊人姓名")
    private String patientName;

    @Schema(description = "录入医生ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7416")
    @ExcelProperty("录入医生ID")
    private Long doctorId;

    @Schema(description = "录入医生姓名（冗余）", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
    @ExcelProperty("录入医生姓名")
    private String doctorName;

    @Schema(description = "手术日期")
    @ExcelProperty("手术日期")
    @JsonSerialize(using = LocalDateSerializer.class) // 序列化（响应）
    @JsonDeserialize(using = LocalDateDeserializer.class) // 反序列化（请求）
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate surgeryDate;

    @Schema(description = "术者", example = "芋艿")
    @ExcelProperty("术者")
    private String surgeryName;

    @Schema(description = "术式（多选：腹腔镜 RP；开放式RP；机器人辅助 RP；筋膜内；筋膜外；前入路；后入路）")
    @ExcelProperty(value = "术式", converter = ListToStringConverter.class)
    private List<String> surgeryMethod;

    @Schema(description = "淋巴结清扫情况（多选：未清扫；标准；扩大）")
    @ExcelProperty(value = "淋巴结清扫情况", converter = ListToStringConverter.class)
    private List<String> lbjqsqk;

    @Schema(description = "淋巴结清扫情况左")
    @ExcelProperty("淋巴结清扫情况左")
    private String lbjqsqkLeft;

    @Schema(description = "淋巴结清扫情况右")
    @ExcelProperty("淋巴结清扫情况右")
    private String lbjqsqkRight;

    @Schema(description = "是否保留性神经（多选：否、保留左侧、保留右侧）")
    @ExcelProperty(value = "是否保留性神经", converter = ListToStringConverter.class)
    private List<String> sfblxsj;

    @Schema(description = "尿管-留置时间")
    @ExcelProperty("尿管-留置时间")
    @JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化（响应）
    @JsonDeserialize(using = LocalDateTimeDeserializer.class) // 反序列化（请求）
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime ngLzsj;

    @Schema(description = "尿管-拔出时间")
    @ExcelProperty("尿管-拔出时间")
    @JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化（响应）
    @JsonDeserialize(using = LocalDateTimeDeserializer.class) // 反序列化（请求）
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime ngBcsj;

    @Schema(description = "引流管-留置时间")
    @ExcelProperty("引流管-留置时间")
    @JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化（响应）
    @JsonDeserialize(using = LocalDateTimeDeserializer.class) // 反序列化（请求）
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime ylgLzsj;

    @Schema(description = "引流管-拔出时间")
    @ExcelProperty("引流管-拔出时间")
    @JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化（响应）
    @JsonDeserialize(using = LocalDateTimeDeserializer.class) // 反序列化（请求）
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime ylgBcsj;

    @Schema(description = "围手术期并发症（多选：无；其它；直肠损失；血管损伤；神经损伤；淋巴漏）")
    @ExcelProperty(value = "围手术期并发症", converter = ListToStringConverter.class)
    private List<String> wssqbfz;

    @Schema(description = "并发症及处理方式")
    @ExcelProperty("并发症及处理方式")
    private String bfzjclfs;

    @Schema(description = "术后诊断")
    @ExcelProperty("术后诊断")
    private String shzd;

    @Schema(description = "Gleason 病理")
    @ExcelProperty("Gleason 病理")
    private String gleasonBl;

    @Schema(description = "病理结果黏贴处")
    @ExcelProperty("病理结果黏贴处")
    private String bljgntc;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;

}
